<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Message extends Model
{
    const CREATED_AT = 'create_time';
    const UPDATED_AT = 'update_time';
    protected $guarded = [];

    public function getMessageTypeAttribute($message_type)
    {

        switch ($message_type) {
            case 1:
                $message_type = '上门评价';
                break;
            case 2:
                $message_type = '结账评价';
                break;
            case 3:
                $message_type = '放款评价';
                break;
            default:
                $message_type = '放款通知';
                break;
        }

        return $this->attributes['message_type'] = $message_type;
    }
}
